<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\Breadcrumbs;

/* @var $this yii\web\View */
/* @var $model app\models\ExcelPd */
/* @var $form yii\widgets\ActiveForm */

$med = $model->getMedCtns();
$append = $model->getMedList('PD');
?>

<style type="text/css">
    .question > select {width: 108px;}
    .question > label {width: 390px; margin-bottom: 0;}
    .table {width: 550px;}
</style>

<div class="form-group">
    <?= Html::label('患者姓名', 'pt_rel') ?><br />
    <?= Html::dropDownList('pt_rel', (!empty($pt_rel)) ? $pt_rel : 0, $pt_rel_list, ($model->isNewRecord) ? ['class' => 'pt_rel_list'] : ['class' => 'pt_rel_list', 'disabled' => 'true']) ?>
</div>

<div class="form-group">
    <?= Html::label('评估时间', 'evaluation_time') ?><br />
    <?= Html::textInput('evaluation_time', empty($evaluation_time) ? '' : $evaluation_time, ['class'=>'form-control laydate-icon date']) ?>
</div>

<?= $form->field($model, 'classify')->textInput(['maxlength' => true]) ?><br />

<?= $form->field($model, 'up_time')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?>

<?= $form->field($model, 'bf_time')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?>

<?= $form->field($model, 'lc_time')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?><br />

<?= $form->field($model, 'dn_time')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?>

<?= $form->field($model, 'sp_time')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?><br />

<?= $form->field($model, 'pbm_solve')->textInput(['maxlength' => true])->error(false) ?>

<!-- 这里真心不好写。虽然我知道不应该这么写 -->
<table border="1px" class="tb-med-list">
    <tr>
        <td rowspan="2">药物名称</td>
        <td colspan="7">上午</td>
        <td colspan="10">下午</td>
    </tr>
    <tr>
    <?php for ($i = 6; $i < 23; $i ++) : ?>
        <td><?= $i ?></td>
    <?php endfor;?>
    </tr>
    <?php foreach ($append as $list) : ?>
    <tr>
        <td>
            <?= $list['med_name'] ?>
        </td>
        <?php for ($i = 6; $i < 23; $i ++) : ?>
        <td><input type="text" name="MedCtn[<?= $list['pk_id'].'_'.$i ?>]" value="<?= empty($med[$list['pk_id']][$i]) ? '' : $med[$list['pk_id']][$i] ?>"></td>
        <?php endfor;?>
    </tr>
    <?php endforeach; ?>
        
</table>

<?= $form->field($model, 'else_ctnt')->textarea(['maxlength' => true]) ?><br />
